//
//  LSZBasicInformatioShowViewController.m
//  PartyClassCloud
//
//  Created by 梁素珍 on 2018/11/27.
//  Copyright © 2018年 九酷. All rights reserved.
//

#import "LSZBasicInformatioShowViewController.h"

@interface LSZBasicInformatioShowViewController ()<UITableViewDataSource,UITableViewDelegate>
@property(nonatomic,strong) UITableView * tableViewBasicInformation;
@property(nonatomic,strong)NSArray * arrayName;
@end

@implementation LSZBasicInformatioShowViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"基本信息";
    [self.tableViewBasicInformation registerNib:[UINib nibWithNibName:@"LSZOrSoTableViewCell" bundle:nil] forCellReuseIdentifier:@"LSZOrSoTableViewCell"];
    self.arrayName = @[@"户主姓名",@"身份证号",@"联系电话",@"贫困状态",@"家庭人口",@"贫困属性",@"致贫原因",@"家庭住址"];
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 45;
}
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
    return 0.001;
}
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
    return 0.001;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 8;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    LSZOrSoTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"LSZOrSoTableViewCell" forIndexPath:indexPath];
    cell.leftLabel.text = self.arrayName[indexPath.row];
    switch (indexPath.row) {
        case 0:
            cell.rightBut.text = self.inquiryPoorHouseholdsMg.name;
            break;
        case 1:
            cell.rightBut.text = self.inquiryPoorHouseholdsMg.idNumber;
            break;
        case 2:
            cell.rightBut.text = self.inquiryPoorHouseholdsMg.contactPhone;
            break;
        case 3:
            cell.rightBut.text = self.inquiryPoorHouseholdsMg.povertyStatus;
            break;
        case 4:
            cell.rightBut.text = self.inquiryPoorHouseholdsMg.personCount;
            break;
        case 5:
            cell.rightBut.text = self.inquiryPoorHouseholdsMg.povertyStatus;
            break;
        case 6:
            cell.rightBut.text = self.inquiryPoorHouseholdsMg.povertyReason;
            break;
        case 7:
            cell.rightBut.text = self.inquiryPoorHouseholdsMg.branchName;
            break;
        default:
            break;
    }
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    return cell;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    
}
-(UITableView *)tableViewBasicInformation
{
    if (_tableViewBasicInformation == nil) {
        _tableViewBasicInformation = [[UITableView alloc]initWithFrame:CGRectMake(0, 0, [[UIScreen mainScreen] bounds].size.width , [[UIScreen mainScreen] bounds].size.height) style:UITableViewStyleGrouped];
        _tableViewBasicInformation.delegate = self;
        _tableViewBasicInformation.dataSource = self;
        _tableViewBasicInformation.estimatedRowHeight=0;
        _tableViewBasicInformation.estimatedSectionFooterHeight =0;
        _tableViewBasicInformation.estimatedSectionHeaderHeight =0;
        [_tableViewBasicInformation setSeparatorInset:UIEdgeInsetsMake(0, 20, 0, 20)];
        [self.view addSubview:_tableViewBasicInformation];
    }
    return _tableViewBasicInformation;
}


@end
